module ProcessQueue.Writter exposing (..)

type Writter a = Writter a (List String)

runLog : Writter a -> List String
runLog (Writter a strs) = strs 

return : a -> Writter a
return a = Writter a []

(>>=) : Writter a -> (a -> Writter b) -> Writter b
(>>=) (Writter a loga) f =
  let (Writter b logb)   = f a
  in  Writter b (loga ++ logb) 

print_log : String -> Writter a -> String
print_log split wa =
  List.foldl (\cur acc -> acc  ++ cur ++ split) "" (runLog wa)